package com.cby.widget.sample.fragments

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.cby.widget.lib.kotlin.*
import com.cby.widget.sample.R

/**
 * @description: BlurMaskFragment
 *
 * @author ChenBaoyang
 * @date 2021/10/3 16:22
 */
class BlurMaskFragment : Fragment() {

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return ConstraintLayout {
            layout_width = match_parent
            layout_height = match_parent

            ImageView {
                layout_width = 100
                layout_height = 100
                scaleType = scale_fit_xy
                center_horizontal = true
                center_vertical = true
                src = R.drawable.meinv
            }

            TextView {
                layout_width  = 100
                layout_height = 50
                text = "show blur mask"
                textSize = 40f
                bottom_toBottomOf = parent_id
                center_horizontal = true
                onClick = {
                    BlurDialogFragment.show(childFragmentManager)
                }
            }
        }
    }

}